class BlogPost
  include Mongoid::Document
  field :title, type: String
  field :content, type: String
  has_and_belongs_to_many :ratings ## mimicing has_many and storing ratings as an array in BlogPost


  def get_posts_num
    BlogPost.count
  end
end
